package leetcode;

/**
 * @author Liangyaoyun
 */
public class leetCode136 {
    public int singleNumber(int[] nums) {
        int single = 0;
        for (int num : nums) {
            //^异或运算,将数字转化为二进制,按位异或,相同为0，不同为1
            //相同的数字结果是0
            single ^= num;
        }
        return single;
    }

}
